/***************************************************************************
 *            camera.h
 *
 *  Mon Aug 25 15:46:49 2008
 *  Copyright  2008  Tiago Falcão
 *  <tiago@tiagofalcao.com>
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */
 
#ifndef CAMERA_H
#define CAMERA_H

#include <GL/gl.h>
#include <GL/glut.h>
#include <math.h>
#include "points.h"

typedef struct camera{
	//posicao da camera
	point_cart from;	//cartesianas
	point_esf from_esf; //esfericas
	
	//alvo da camera
	point_cart to;
	
	//vetor para cima
	point_cart upper;
	point_esf upper_esf;
	
	//Aspecto de Projecao
	GLfloat aspect;
}camera_t;

//Camera
camera_t camera;

// Inicializa Posicao da Camera
void cam_init();

// Calcula posição cartesiana da camera
void cam_update();

// Posiciona da Camera
void cam_setup();

//Seta Correcao de Aspecto
void cam_aspect(GLfloat aspect);

// Move camera no eixo X
void cam_trans_x(short int signal);
// Move camera no eixo Y
void cam_trans_y(short int signal);
// Move camera no eixo Z
void cam_trans_z(short int signal);

// Rotaciona Camera com Theta
void cam_rot_theta(short int signal);
// Rotaciona Camera com Phi
void cam_rot_phi(short int signal);
// Distacia da Camera
void cam_zoom(short int signal);

#endif /* CAMERA_H */

